<template>
  <label class="m-checkbox" :for="label" :class="{disabled: disabled}">
    <input type="checkbox" 
      v-model="model"
      :name="name"
      :id="label"
      :value="result"
      :disabled="disabled"
      @change="onChange">
    <span class="check-btn"></span>
    <slot></slot> 
  </label> 
</template>

<script>
export default {
  props: {
    result: [Number, String, Object, Array],
    label: {
      type: [String, Number],
      default: ''
    },
    name: {
      type: String,
      deufult: null
    },
    disabled: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      model: []
    }
  },
  methods: {
    onChange() {
      this.$parent.change(this.model)
    }
  }
}
</script>

<style lang="scss" scoped>
  @import '../../scss/_checkbox.scss';
</style>